package jp.ac.hosei.gaedemo.meta;

//@javax.annotation.Generated(value = { "slim3-gen", "@VERSION@" }, date = "2011-12-20 05:08:58")
/** */
public final class ScheduleMeta extends org.slim3.datastore.ModelMeta<jp.ac.hosei.gaedemo.model.Schedule> {

    /** */
    public final org.slim3.datastore.StringAttributeMeta<jp.ac.hosei.gaedemo.model.Schedule> attachmentKey = new org.slim3.datastore.StringAttributeMeta<jp.ac.hosei.gaedemo.model.Schedule>(this, "attachmentKey", "attachmentKey");

    /** */
    public final org.slim3.datastore.StringAttributeMeta<jp.ac.hosei.gaedemo.model.Schedule> comment = new org.slim3.datastore.StringAttributeMeta<jp.ac.hosei.gaedemo.model.Schedule>(this, "comment", "comment");

    /** */
    public final org.slim3.datastore.StringAttributeMeta<jp.ac.hosei.gaedemo.model.Schedule> content = new org.slim3.datastore.StringAttributeMeta<jp.ac.hosei.gaedemo.model.Schedule>(this, "content", "content");

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<jp.ac.hosei.gaedemo.model.Schedule, java.util.Date> createDate = new org.slim3.datastore.CoreAttributeMeta<jp.ac.hosei.gaedemo.model.Schedule, java.util.Date>(this, "createDate", "createDate", java.util.Date.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<jp.ac.hosei.gaedemo.model.Schedule, java.util.Date> endDate = new org.slim3.datastore.CoreAttributeMeta<jp.ac.hosei.gaedemo.model.Schedule, java.util.Date>(this, "endDate", "endDate", java.util.Date.class);

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<jp.ac.hosei.gaedemo.model.Schedule, com.google.appengine.api.datastore.Key> key = new org.slim3.datastore.CoreAttributeMeta<jp.ac.hosei.gaedemo.model.Schedule, com.google.appengine.api.datastore.Key>(this, "__key__", "key", com.google.appengine.api.datastore.Key.class);

    /** */
    public final org.slim3.datastore.StringAttributeMeta<jp.ac.hosei.gaedemo.model.Schedule> place = new org.slim3.datastore.StringAttributeMeta<jp.ac.hosei.gaedemo.model.Schedule>(this, "place", "place");

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<jp.ac.hosei.gaedemo.model.Schedule, java.util.Date> startDate = new org.slim3.datastore.CoreAttributeMeta<jp.ac.hosei.gaedemo.model.Schedule, java.util.Date>(this, "startDate", "startDate", java.util.Date.class);

    /** */
    public final org.slim3.datastore.StringAttributeMeta<jp.ac.hosei.gaedemo.model.Schedule> title = new org.slim3.datastore.StringAttributeMeta<jp.ac.hosei.gaedemo.model.Schedule>(this, "title", "title");

    /** */
    public final org.slim3.datastore.CoreAttributeMeta<jp.ac.hosei.gaedemo.model.Schedule, java.lang.Long> version = new org.slim3.datastore.CoreAttributeMeta<jp.ac.hosei.gaedemo.model.Schedule, java.lang.Long>(this, "version", "version", java.lang.Long.class);

    private static final ScheduleMeta slim3_singleton = new ScheduleMeta();

    /**
     * @return the singleton
     */
    public static ScheduleMeta get() {
       return slim3_singleton;
    }

    /** */
    public ScheduleMeta() {
        super("Schedule", jp.ac.hosei.gaedemo.model.Schedule.class);
    }

    @Override
    public jp.ac.hosei.gaedemo.model.Schedule entityToModel(com.google.appengine.api.datastore.Entity entity) {
        jp.ac.hosei.gaedemo.model.Schedule model = new jp.ac.hosei.gaedemo.model.Schedule();
        model.setAttachmentKey((java.lang.String) entity.getProperty("attachmentKey"));
        model.setComment((java.lang.String) entity.getProperty("comment"));
        model.setContent((java.lang.String) entity.getProperty("content"));
        model.setCreateDate((java.util.Date) entity.getProperty("createDate"));
        model.setEndDate((java.util.Date) entity.getProperty("endDate"));
        model.setKey(entity.getKey());
        model.setPlace((java.lang.String) entity.getProperty("place"));
        model.setStartDate((java.util.Date) entity.getProperty("startDate"));
        model.setTitle((java.lang.String) entity.getProperty("title"));
        model.setVersion((java.lang.Long) entity.getProperty("version"));
        return model;
    }

    @Override
    public com.google.appengine.api.datastore.Entity modelToEntity(java.lang.Object model) {
        jp.ac.hosei.gaedemo.model.Schedule m = (jp.ac.hosei.gaedemo.model.Schedule) model;
        com.google.appengine.api.datastore.Entity entity = null;
        if (m.getKey() != null) {
            entity = new com.google.appengine.api.datastore.Entity(m.getKey());
        } else {
            entity = new com.google.appengine.api.datastore.Entity(kind);
        }
        entity.setProperty("attachmentKey", m.getAttachmentKey());
        entity.setProperty("comment", m.getComment());
        entity.setProperty("content", m.getContent());
        entity.setProperty("createDate", m.getCreateDate());
        entity.setProperty("endDate", m.getEndDate());
        entity.setProperty("place", m.getPlace());
        entity.setProperty("startDate", m.getStartDate());
        entity.setProperty("title", m.getTitle());
        entity.setProperty("version", m.getVersion());
        entity.setProperty("slim3.schemaVersion", 1);
        return entity;
    }

    @Override
    protected com.google.appengine.api.datastore.Key getKey(Object model) {
        jp.ac.hosei.gaedemo.model.Schedule m = (jp.ac.hosei.gaedemo.model.Schedule) model;
        return m.getKey();
    }

    @Override
    protected void setKey(Object model, com.google.appengine.api.datastore.Key key) {
        validateKey(key);
        jp.ac.hosei.gaedemo.model.Schedule m = (jp.ac.hosei.gaedemo.model.Schedule) model;
        m.setKey(key);
    }

    @Override
    protected long getVersion(Object model) {
        jp.ac.hosei.gaedemo.model.Schedule m = (jp.ac.hosei.gaedemo.model.Schedule) model;
        return m.getVersion() != null ? m.getVersion().longValue() : 0L;
    }

    @Override
    protected void assignKeyToModelRefIfNecessary(com.google.appengine.api.datastore.AsyncDatastoreService ds, java.lang.Object model) {
    }

    @Override
    protected void incrementVersion(Object model) {
        jp.ac.hosei.gaedemo.model.Schedule m = (jp.ac.hosei.gaedemo.model.Schedule) model;
        long version = m.getVersion() != null ? m.getVersion().longValue() : 0L;
        m.setVersion(Long.valueOf(version + 1L));
    }

    @Override
    protected void prePut(Object model) {
    }

    @Override
    protected void postGet(Object model) {
    }

    @Override
    public String getSchemaVersionName() {
        return "slim3.schemaVersion";
    }

    @Override
    public String getClassHierarchyListName() {
        return "slim3.classHierarchyList";
    }

    @Override
    protected boolean isCipherProperty(String propertyName) {
        return false;
    }

    @Override
    protected void modelToJson(org.slim3.datastore.json.JsonWriter writer, java.lang.Object model, int maxDepth, int currentDepth) {
        jp.ac.hosei.gaedemo.model.Schedule m = (jp.ac.hosei.gaedemo.model.Schedule) model;
        writer.beginObject();
        org.slim3.datastore.json.Default encoder0 = new org.slim3.datastore.json.Default();
        if(m.getAttachmentKey() != null){
            writer.setNextPropertyName("attachmentKey");
            encoder0.encode(writer, m.getAttachmentKey());
        }
        if(m.getComment() != null){
            writer.setNextPropertyName("comment");
            encoder0.encode(writer, m.getComment());
        }
        if(m.getContent() != null){
            writer.setNextPropertyName("content");
            encoder0.encode(writer, m.getContent());
        }
        if(m.getCreateDate() != null){
            writer.setNextPropertyName("createDate");
            encoder0.encode(writer, m.getCreateDate());
        }
        if(m.getEndDate() != null){
            writer.setNextPropertyName("endDate");
            encoder0.encode(writer, m.getEndDate());
        }
        if(m.getKey() != null){
            writer.setNextPropertyName("key");
            encoder0.encode(writer, m.getKey());
        }
        if(m.getPlace() != null){
            writer.setNextPropertyName("place");
            encoder0.encode(writer, m.getPlace());
        }
        if(m.getStartDate() != null){
            writer.setNextPropertyName("startDate");
            encoder0.encode(writer, m.getStartDate());
        }
        if(m.getTitle() != null){
            writer.setNextPropertyName("title");
            encoder0.encode(writer, m.getTitle());
        }
        if(m.getVersion() != null){
            writer.setNextPropertyName("version");
            encoder0.encode(writer, m.getVersion());
        }
        writer.endObject();
    }

    @Override
    protected jp.ac.hosei.gaedemo.model.Schedule jsonToModel(org.slim3.datastore.json.JsonRootReader rootReader, int maxDepth, int currentDepth) {
        jp.ac.hosei.gaedemo.model.Schedule m = new jp.ac.hosei.gaedemo.model.Schedule();
        org.slim3.datastore.json.JsonReader reader = null;
        org.slim3.datastore.json.Default decoder0 = new org.slim3.datastore.json.Default();
        reader = rootReader.newObjectReader("attachmentKey");
        m.setAttachmentKey(decoder0.decode(reader, m.getAttachmentKey()));
        reader = rootReader.newObjectReader("comment");
        m.setComment(decoder0.decode(reader, m.getComment()));
        reader = rootReader.newObjectReader("content");
        m.setContent(decoder0.decode(reader, m.getContent()));
        reader = rootReader.newObjectReader("createDate");
        m.setCreateDate(decoder0.decode(reader, m.getCreateDate()));
        reader = rootReader.newObjectReader("endDate");
        m.setEndDate(decoder0.decode(reader, m.getEndDate()));
        reader = rootReader.newObjectReader("key");
        m.setKey(decoder0.decode(reader, m.getKey()));
        reader = rootReader.newObjectReader("place");
        m.setPlace(decoder0.decode(reader, m.getPlace()));
        reader = rootReader.newObjectReader("startDate");
        m.setStartDate(decoder0.decode(reader, m.getStartDate()));
        reader = rootReader.newObjectReader("title");
        m.setTitle(decoder0.decode(reader, m.getTitle()));
        reader = rootReader.newObjectReader("version");
        m.setVersion(decoder0.decode(reader, m.getVersion()));
        return m;
    }
}